public class Test2 {
    public int i;
    public double d;

    public Test2() {}
    public Test2(int i, double d) throws RuntimeException {
        this.i = i;
        makeException();
        this.d = d;
    }

    private void makeException() throws RuntimeException {
        throw new RuntimeException();
    }

    @Override
    public String toString() {
        return "Test2{" +
                "i=" + i +
                ", d=" + d +
                '}';
    }
}

class Test22 {
    public static void main(String[] args) {
        Test2 t = new Test2();
        try {
            t = new Test2(100, 2.0);
        } catch (Exception e) {
            e.printStackTrace();
        }

        // 因为异常出现在构造函数中 导致对象没有成功构建 new 操作符什么也不做
        System.out.println(t);
    }
}